﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Clinica/MasterPageHistoria.master" AutoEventWireup="true" CodeFile="wfHistoriaClinicaListado.aspx.cs" Inherits="Clinica_HistoriaClinicaListado" %>

<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .pnlFiltro
        {
            margin: 0.25em 0;
        }
        .izq
        {
            width: 15%;
            vertical-align: top;
        }
        .der
        {
            width: 85%;
            vertical-align: top;
        }
        .gridDetlle
        {
            margin-left: 2em;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMenuSecundario" runat="Server">
    <li><a class="active" href="wfHistoriaClinicaListado.aspx">Listado de Historia Cl&iacute;nica</a></li>
   <!-- <li><a class="" href="wfAsignarHistoriaDefinitiva.aspx">Asignar Historia Definitiva</a></li>
    <li><a class="" href="wfSolicitarHistoriaClinica.aspx">Solicitar Historia Cl&iacute;nica</a></li>
    <li><a class="" href="wfRegistrarMovimientoHistoriaClinica.aspx">Registrar Movimiento Historia Cl&iacute;nica</a></li>-->
    <li></li>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ModuleTitleContent" runat="Server">
    Historia Clínica
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentEnlacesRapidos" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <%--<ul class="tabs primary">
                <li class="active"><a href="wfHistoriaClinicaListado.aspx">Listado de Historias Clinicas</a></li>
            </ul>--%>
            <h4>Listado de Historias Cl&iacute;nicas</h4>
            <script language="javascript" type="text/javascript">
                function confirmSubmit() { pcEliminar.Show(); }
                function confirmSubmitResult() { }
                function MostrarDetalle(e) { dgvListadoHistoriaClinica.ExpandDetailRow(e.visibleIndex); }
                function verDetalle() { btnMostrar.DoClick(); }
                function ShowMensaje() { pc_Mensaje.Show(); }
                function DetallePopUp(tipo) 
                {
                    pcDetalleAtencion.Hide();
                    switch (tipo) 
                    {
                        case 1:
                            btnDetalleDiagnostico.DoClick();
                            break;
                        case 2:
                            btnDetalleExamenes.DoClick();
                            break;
                        case 3:
                            btnDetalleHospitalizaciones.DoClick();
                            break;
                        case 4:
                            btnDetalleMedicamentos.DoClick();
                            break;
                        default:
                            alert("No Se Ha Seleccionado Ningun Registro de Ninguna Tabla.");
                            break;
                    }
                }
            </script>
            <table width="99%">
                <tr>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="99%">
                            <PanelCollection>
                                <dx:PanelContent ID="PanelContent1" runat="server">
                                    <table>
                                        <tr>
                                            <td>
                                                <dx:ASPxButton ID="btnBuscar" runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" AutoPostBack="false" CssPostfix="PlasticBlue" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css"
                                                    Text="Buscar Historia Clinica" OnClick="BuscarHistoriaClinica">
                                                </dx:ASPxButton>
                                            </td>
                                            <td>
                                                <dx:ASPxButton ID="btnLimpiarFiltros" runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" AutoPostBack="false" CssPostfix="PlasticBlue" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css"
                                                    Text="Limpiar Filtro" OnClick="LimpiarFiltros">
                                                </dx:ASPxButton>
                                            </td>
                                            <td>
                                                <dx:ASPxButton ID="btnreporte" runat="server" 
                                                    CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" 
                                                    OnClick="btnreporte_Click" 
                                                    SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" 
                                                    Text="Mostrar Reporte">
                                                </dx:ASPxButton>
                                            </td> 
                                        </tr>
                                    </table>
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="100%" CssClass="pnlFiltro">
                            <PanelCollection>
                                <dx:PanelContent runat="server">
                                    <table class="style1">
                                        <tr>
                                            <td>
                                                <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Nro de Historia Clinica">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtNroHC" runat="server" Width="170px" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                    <ValidationSettings>
                                                        <ErrorFrameStyle ImageSpacing="4px">
                                                            <ErrorTextPaddings PaddingLeft="4px" />
                                                        </ErrorFrameStyle>
                                                    </ValidationSettings>
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="DNI">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtDNI" runat="server" Width="170px" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                    <ValidationSettings>
                                                        <ErrorFrameStyle ImageSpacing="4px">
                                                            <ErrorTextPaddings PaddingLeft="4px" />
                                                        </ErrorFrameStyle>
                                                    </ValidationSettings>
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Nombres y Apellidos">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td>
                                                <dx:ASPxTextBox ID="txtnomPaciente" runat="server" Width="170px" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                    <ValidationSettings>
                                                        <ErrorFrameStyle ImageSpacing="4px">
                                                            <ErrorTextPaddings PaddingLeft="4px" />
                                                        </ErrorFrameStyle>
                                                    </ValidationSettings>
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </td>
                </tr>
                <tr>
                    <td style="width: 98%; vertical-align: top;">
                        <dx:ASPxPanel ID="pnlListadoHC" runat="server">
                            <PanelCollection>
                                <dx:PanelContent>
                                    <dx:ASPxGridView ID="dgvListadoHistoriaClinica" ClientInstanceName="dgvListadoHistoriaClinica" runat="server" Width="100%" AutoGenerateColumns="False" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                                        CssPostfix="PlasticBlue" KeyFieldName="PAC_ID_PACIENTE" OnPageIndexChanged="dgvListadoHistoriaClinica_PageIndexChanged" OnAfterPerformCallback="dgvListadoHistoriaClinica_AfterPerformCallback">
                                        <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                            <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                            </LoadingPanelOnStatusBar>
                                            <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </Images>
                                        <ImagesFilterControl>
                                            <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                            </LoadingPanel>
                                        </ImagesFilterControl>
                                        <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                            <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                            </Header>
                                        </Styles>
                                        <StylesEditors>
                                            <CalendarHeader Spacing="11px">
                                            </CalendarHeader>
                                            <ProgressBar Height="25px">
                                            </ProgressBar>
                                        </StylesEditors>
                                        <Templates>
                                            <DetailRow>
                                                <dx:ASPxGridView ID="dgvAtenciones" runat="server" Width="80%" OnBeforePerformDataSelect="dgvAtenciones_DataSelect" AutoGenerateColumns="False" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue"
                                                    OnAfterPerformCallback="dgvAtenciones_AfterPerformCallback" OnPageIndexChanged="dgvAtenciones_PageIndexChanged" KeyFieldName="ATE_ID_ATENCION" DataSourceID="odsAtenciones" CssClass="gridDetlle">
                                                    <ClientSideEvents RowDblClick="function(s, e) {verDetalle();}" />
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="ATE_ID_ATENCION" ShowInCustomizationForm="True" Visible="False" VisibleIndex="0">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn FieldName="ATE_FECHA_INGRESO" ShowInCustomizationForm="True" VisibleIndex="1" Caption="Atenciones">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn FieldName="GHC_NRO_HISTORIA_CLINICA" ShowInCustomizationForm="True" VisibleIndex="2" Visible="false">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn FieldName="HC_ID_HISTORIA_CLINICA" ShowInCustomizationForm="True" VisibleIndex="3" Visible="false">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                    <SettingsPager PageSize="5" ShowDefaultImages="False">
                                                        <AllButton Text="All">
                                                        </AllButton>
                                                        <NextPageButton Text="Next &gt;">
                                                        </NextPageButton>
                                                        <PrevPageButton Text="&lt; Prev">
                                                        </PrevPageButton>
                                                    </SettingsPager>
                                                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                                        </LoadingPanelOnStatusBar>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                                        </LoadingPanel>
                                                    </Images>
                                                    <ImagesFilterControl>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                                        </LoadingPanel>
                                                    </ImagesFilterControl>
                                                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                        </Header>
                                                    </Styles>
                                                    <StylesEditors>
                                                        <CalendarHeader Spacing="11px">
                                                        </CalendarHeader>
                                                        <ProgressBar Height="25px">
                                                        </ProgressBar>
                                                    </StylesEditors>
                                                </dx:ASPxGridView>
                                                <asp:ObjectDataSource ID="odsAtenciones" runat="server" SelectMethod="listarAtencion" TypeName="Capa_Negocio_Facade.FacadeRegistrarHistoriaClinica">
                                                    <SelectParameters>
                                                        <asp:SessionParameter Name="nroHC" SessionField="nroHC" Type="Int32" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <dx:ASPxButton ID="btnMostrar" ClientInstanceName="btnMostrar" runat="server" OnClick="Mostrar" ClientVisible="false">
                                                </dx:ASPxButton>
                                            </DetailRow>
                                        </Templates>
                                        <Columns>
                                            <dx:GridViewDataTextColumn FieldName="PAC_ID_PACIENTE" VisibleIndex="0" 
                                                Caption="ID" Visible="false">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Fecha Creacion" 
                                                FieldName="HC_FECHA_CREACION" VisibleIndex="1">
                                                <PropertiesTextEdit DisplayFormatString="d">
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="Autogenerado" 
                                                FieldName="GHC_NRO_HISTORIA_CLINICA" VisibleIndex="2">
                                                <PropertiesDateEdit DisplayFormatString="">
                                                    <CalendarProperties ClearButtonText="Vaciar" TodayButtonText="Hoy">
                                                        <FastNavProperties CancelButtonText="Cancelar" OkButtonText="Aceptar" />
                                                    </CalendarProperties>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn FieldName="PAC_NRO_DOCUMENTO" VisibleIndex="3" 
                                                Caption="Nro Documento">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="NOMBRES" VisibleIndex="4" 
                                                Caption="Nombres">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="HC_ID_HISTORIA_CLINICA" VisibleIndex="5" 
                                                Visible="False">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="ATE_ID_ATENCION" 
                                                ShowInCustomizationForm="True" Visible="False" VisibleIndex="6">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <SettingsBehavior AllowFocusedRow="True" />
                                        <SettingsPager ShowDefaultImages="False">
                                            <AllButton Text="All">
                                            </AllButton>
                                            <NextPageButton Text="Next &gt;">
                                            </NextPageButton>
                                            <PrevPageButton Text="&lt; Prev">
                                            </PrevPageButton>
                                        </SettingsPager>
                                        <SettingsLoadingPanel Text="Cargando&amp;hellip;" />
                                        <SettingsDetail ShowDetailRow="True" ShowDetailButtons="False" />
                                        <ClientSideEvents RowDblClick="function(s, e) {MostrarDetalle(e);}" />
                                    </dx:ASPxGridView>
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <dx:ASPxPopupControl ID="pcDetalleAtencion" runat="server" Width="950px" 
                            Height="600px" ScrollBars="Vertical" AllowDragging="False" AllowResize="False" 
                            ClientInstanceName="pcDetalleAtencion" CloseAction="CloseButton"
                            HeaderText="Detalle de La Atencion" Modal="True" 
                            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                            DragElement="Window" ShowPageScrollbarWhenModal="True">
                            <HeaderStyle Font-Bold="True" BackColor="#3D5294" ForeColor="White" />
                            <ContentCollection>
                                <dx:PopupControlContentControl runat="server">
                                    <table class="style1">
                                        <tr>
                                            <td class="izq">
                                                <dx:ASPxLabel ID="lblDiag" runat="server" Text="Diagnosticos">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td class="der">
                                                <dx:ASPxGridView ID="dgvDiagnosticos" runat="server" KeyFieldName="ATD_ID_DIAGNOSTICO" OnAfterPerformCallback="dgvDiagnosticos_AfterPerformCallback" OnPageIndexChanged="dgvDiagnosticos_PageIndexChanged"
                                                    CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" Width="100%">
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="ATD_ID_DIAGNOSTICO" ShowInCustomizationForm="True" VisibleIndex="0" Visible="False">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Codigo" FieldName="DIA_CODIGO_CIE10" ShowInCustomizationForm="True" VisibleIndex="1">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Descripcion" FieldName="DIA_DESCRIPCION" ShowInCustomizationForm="True" VisibleIndex="2">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                    <SettingsPager PageSize="5" ShowDefaultImages="False">
                                                        <AllButton Text="All">
                                                        </AllButton>
                                                        <NextPageButton Text="Next &gt;">
                                                        </NextPageButton>
                                                        <PrevPageButton Text="&lt; Prev">
                                                        </PrevPageButton>
                                                    </SettingsPager>
                                                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                                        </LoadingPanelOnStatusBar>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                                        </LoadingPanel>
                                                    </Images>
                                                    <ImagesFilterControl>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                                        </LoadingPanel>
                                                    </ImagesFilterControl>
                                                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                        </Header>
                                                    </Styles>
                                                    <StylesEditors>
                                                        <CalendarHeader Spacing="11px">
                                                        </CalendarHeader>
                                                        <ProgressBar Height="50px">
                                                        </ProgressBar>
                                                    </StylesEditors>
                                                    <ClientSideEvents RowDblClick="function(s, e){ DetallePopUp(1); } " />
                                                </dx:ASPxGridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="izq">
                                                <dx:ASPxLabel ID="lblExams" runat="server" Text="Examenes">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td class="der">
                                                <dx:ASPxGridView ID="dgvExamenes" runat="server" KeyFieldName="ATE_ID_EXAMEN" OnAfterPerformCallback="dgvExamenes_AfterPerformCallback" OnPageIndexChanged="dgvExamenes_PageIndexChanged" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                                                    CssPostfix="PlasticBlue" Width="100%">
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="ATE_ID_EXAMEN" ShowInCustomizationForm="True" VisibleIndex="0" Visible="False">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Fecha" FieldName="ATE_FECHA" ShowInCustomizationForm="True" VisibleIndex="1">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Examen" FieldName="ATE_DESCRIPCION" ShowInCustomizationForm="True" VisibleIndex="2">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Medico" FieldName="MEDICO" ShowInCustomizationForm="True" VisibleIndex="3">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                    <SettingsPager PageSize="5" ShowDefaultImages="False">
                                                        <AllButton Text="All">
                                                        </AllButton>
                                                        <NextPageButton Text="Next &gt;">
                                                        </NextPageButton>
                                                        <PrevPageButton Text="&lt; Prev">
                                                        </PrevPageButton>
                                                    </SettingsPager>
                                                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                                        </LoadingPanelOnStatusBar>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                                        </LoadingPanel>
                                                    </Images>
                                                    <ImagesFilterControl>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                                        </LoadingPanel>
                                                    </ImagesFilterControl>
                                                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                        </Header>
                                                    </Styles>
                                                    <StylesEditors>
                                                        <CalendarHeader Spacing="11px">
                                                        </CalendarHeader>
                                                        <ProgressBar Height="50px">
                                                        </ProgressBar>
                                                    </StylesEditors>
                                                    <ClientSideEvents RowDblClick="function(s, e){ DetallePopUp(2); } " />
                                                </dx:ASPxGridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="izq">
                                                <dx:ASPxLabel ID="lblHisHost" runat="server" Text="Hospitalizaciones">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td class="der">
                                                <dx:ASPxGridView ID="dgvHospitalizaciones" runat="server" KeyFieldName="REC_ID_RESERVACION_CAMAS" OnAfterPerformCallback="dgvHospitalizaciones_AfterPerformCallback" OnPageIndexChanged="dgvHospitalizaciones_PageIndexChanged"
                                                    CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" Width="100%">
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="REC_ID_RESERVACION_CAMAS" ShowInCustomizationForm="True" VisibleIndex="0" Visible="False">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Fecha de Reserva" FieldName="REC_FECHA_HORA_RESERVA" ShowInCustomizationForm="True" VisibleIndex="1">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Fecha de Ingreso" FieldName="REC_FECHA_HORA_INGRESO" ShowInCustomizationForm="True" VisibleIndex="2">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Medico Tratante" FieldName="MEDICO" ShowInCustomizationForm="True" VisibleIndex="3">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                    <SettingsPager PageSize="5" ShowDefaultImages="False">
                                                        <AllButton Text="All">
                                                        </AllButton>
                                                        <NextPageButton Text="Next &gt;">
                                                        </NextPageButton>
                                                        <PrevPageButton Text="&lt; Prev">
                                                        </PrevPageButton>
                                                    </SettingsPager>
                                                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                                        </LoadingPanelOnStatusBar>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                                        </LoadingPanel>
                                                    </Images>
                                                    <ImagesFilterControl>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                                        </LoadingPanel>
                                                    </ImagesFilterControl>
                                                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                        </Header>
                                                    </Styles>
                                                    <StylesEditors>
                                                        <CalendarHeader Spacing="11px">
                                                        </CalendarHeader>
                                                        <ProgressBar Height="25px">
                                                        </ProgressBar>
                                                    </StylesEditors>
                                                    <ClientSideEvents RowDblClick="function(s, e){ DetallePopUp(3); } " />
                                                </dx:ASPxGridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="izq">
                                                <dx:ASPxLabel ID="lblMed" runat="server" Text="Medicamentos">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td class="der">
                                                <dx:ASPxGridView ID="dgvMedicamentos" runat="server" KeyFieldName="PRO_ID_PRODUCTO" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" OnAfterPerformCallback="dgvMedicamentos_AfterPerformCallback"
                                                    OnPageIndexChanged="dgvMedicamentos_PageIndexChanged" Width="100%">
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="PRO_ID_PRODUCTO" ShowInCustomizationForm="True" VisibleIndex="0" Visible="False">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Nro de Receta" FieldName="ATR_NRO_RECETA" ShowInCustomizationForm="True" VisibleIndex="1">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Fecha de Receta" FieldName="ATR_FECHA" ShowInCustomizationForm="True" VisibleIndex="2">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Medicamento" FieldName="PRO_DES_PRODUCTO" ShowInCustomizationForm="True" VisibleIndex="3">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                    <SettingsPager PageSize="5" ShowDefaultImages="False">
                                                        <AllButton Text="All">
                                                        </AllButton>
                                                        <NextPageButton Text="Next &gt;">
                                                        </NextPageButton>
                                                        <PrevPageButton Text="&lt; Prev">
                                                        </PrevPageButton>
                                                    </SettingsPager>
                                                    <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
                                                        </LoadingPanelOnStatusBar>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
                                                        </LoadingPanel>
                                                    </Images>
                                                    <ImagesFilterControl>
                                                        <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
                                                        </LoadingPanel>
                                                    </ImagesFilterControl>
                                                    <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                        <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                        </Header>
                                                    </Styles>
                                                    <StylesEditors>
                                                        <CalendarHeader Spacing="11px">
                                                        </CalendarHeader>
                                                        <ProgressBar Height="25px">
                                                        </ProgressBar>
                                                    </StylesEditors>
                                                    <ClientSideEvents RowDblClick="function(s, e){ DetallePopUp(4); } " />
                                                </dx:ASPxGridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="izq">
                                                &nbsp;
                                            </td>
                                            <td class="der">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" style="padding: 0 20px 0 0;" colspan="2">
                                                <dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Aceptar" Checked="True">
                                                    <ClientSideEvents Click="function(s, e) {pcDetalleAtencion.Hide();}" />
                                                    <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </CheckedStyle>
                                                    <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </HoverStyle>
                                                </dx:ASPxButton>
                                                <dx:ASPxButton ID="btnDetalleDiagnostico" ClientInstanceName="btnDetalleDiagnostico" runat="server" AutoPostBack="false" OnClick="DetalleDiagnostico" ClientVisible="false">
                                                </dx:ASPxButton>
                                                <dx:ASPxButton ID="btnDetalleExamenes" ClientInstanceName="btnDetalleExamenes" runat="server" AutoPostBack="false" OnClick="DetalleExamenes" ClientVisible="false">
                                                </dx:ASPxButton>
                                                <dx:ASPxButton ID="btnDetalleHospitalizaciones" ClientInstanceName="btnDetalleHospitalizaciones" runat="server" AutoPostBack="false" OnClick="DetalleHospitalizaciones" ClientVisible="false">
                                                </dx:ASPxButton>
                                                <dx:ASPxButton ID="btnDetalleMedicamentos" ClientInstanceName="btnDetalleMedicamentos" runat="server" AutoPostBack="false" OnClick="DetalleMedicamentos" ClientVisible="false">
                                                </dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </dx:PopupControlContentControl>
                            </ContentCollection>
                        </dx:ASPxPopupControl>
                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                    </td>
                </tr>
                <tr>
                    <td>
                        <dx:ASPxPopupControl ID="pcEliminar" runat="server" Width="350px" AllowDragging="True" AllowResize="True" ClientInstanceName="pcEliminar" CloseAction="CloseButton" HeaderText="Eliminar" Modal="True" PopupHorizontalAlign="WindowCenter"
                            PopupVerticalAlign="WindowCenter" DragElement="Window">
                            <HeaderImage Url="~/Imagenes/delete2.png" Width="20px">
                            </HeaderImage>
                            <HeaderStyle Font-Bold="True" BackColor="#3D5294" ForeColor="White" />
                            <ContentCollection>
                                <dx:PopupControlContentControl runat="server">
                                    <table class="style1">
                                        <tr>
                                            <td colspan="2" style="padding: 0 0 0 20px;">
                                                ¿Está Seguro De Querer Eliminar La Historia Cl&iacute;nica?<hr />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="padding: 0 20px 0 0;">
                                                <dx:ASPxButton ID="btnAceptarEliminar" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Aceptar" Checked="True">
                                                    <ClientSideEvents Click="function(s, e) {
	                                                                                                                                pcEliminar.Hide();
	                                                                                                                                confirmSubmitResult();    
                                                                                                                                }" />
                                                    <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </CheckedStyle>
                                                    <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </HoverStyle>
                                                </dx:ASPxButton>
                                            </td>
                                            <td align="left" style="padding: 0 0 0 20px;">
                                                <dx:ASPxButton ID="btnCancelarEliminar" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Cancelar" Checked="True">
                                                    <ClientSideEvents Click="function(s, e) {pcEliminar.Hide();}" />
                                                    <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </CheckedStyle>
                                                    <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </HoverStyle>
                                                </dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </dx:PopupControlContentControl>
                            </ContentCollection>
                        </dx:ASPxPopupControl>
                        <dx:ASPxPopupControl ID="pcMensaje" runat="server" Width="350px" AllowDragging="True" AllowResize="True" ClientInstanceName="pcMensaje" CloseAction="CloseButton" HeaderText="Mensaje" Modal="True" PopupHorizontalAlign="WindowCenter"
                            PopupVerticalAlign="WindowCenter" DragElement="Window">
                            <HeaderImage Url="~/Imagenes/iconError.png" Width="20px">
                            </HeaderImage>
                            <HeaderStyle Font-Bold="True" BackColor="#3D5294" ForeColor="White" />
                            <ContentCollection>
                                <dx:PopupControlContentControl runat="server">
                                    <table width="100%">
                                        <tr>
                                            <td style="padding: 0 0 0 20px; text-align: center">
                                                <dx:ASPxLabel ID="lblMensaje" runat="server">
                                                </dx:ASPxLabel>
                                                <hr />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <dx:ASPxButton ID="btnAceptar" runat="server" AutoPostBack="False" ClientIDMode="AutoID" Text="Aceptar" Checked="True">
                                                    <ClientSideEvents Click="function(s, e) {pcMensaje.Hide();}" />
                                                    <CheckedStyle BackColor="#000066" Font-Bold="True" Font-Italic="False" Font-Names="Georgia" Font-Strikeout="False" ForeColor="White">
                                                    </CheckedStyle>
                                                    <HoverStyle BackColor="#000099" Font-Bold="True" Font-Names="Georgia" ForeColor="White">
                                                    </HoverStyle>
                                                </dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </dx:PopupControlContentControl>
                            </ContentCollection>
                        </dx:ASPxPopupControl>
                        <dx:ASPxPopupControl ID="PcReporte" runat="server" 
                            ClientInstanceName="PcReporte" CloseAction="CloseButton" 
                            CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" 
                            HeaderText="Reporte" Height="600px" Modal="True" 
                            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" Width="1000px" 
                            AllowDragging="True" ScrollBars="Vertical" ShowPageScrollbarWhenModal="True">
                            <LoadingPanelImage Url="~/App_Themes/PlasticBlue/Web/dvLoading.gif">
                            </LoadingPanelImage>
                            <CloseButtonStyle>
                                <Paddings Padding="0px" />
                            </CloseButtonStyle>
                            <ContentStyle>
                                <BorderBottom BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" />
                            </ContentStyle>
                            <HeaderStyle>
                            <Paddings PaddingBottom="4px" PaddingLeft="10px" PaddingRight="4px" 
                                PaddingTop="4px" />
                            </HeaderStyle>
                            <ContentCollection>
                                <dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                        <ContentTemplate>
                                            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
                                                AutoDataBind="true" />
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </dx:PopupControlContentControl>
                            </ContentCollection>
                        </dx:ASPxPopupControl>
                        <br />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
